:root {
    --background-color: #2c3e50;
    --border-color: #7591AD;
    --text-color: #34495e;
    --color1: #EC3E27;
    --color2: #fd79a8;
    --color3: #0984e3;
    --color4: #00b894;
    --color5: #fdcb6e;
    --color6: #e056fd;
    --color7: #F97F51;
    --color8: #BDC581;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
}

body {
    width: 100vw;
    height: 100vh;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Montserrat', sans-serif, Arial, 'Microsoft Yahei';
}

.container {
    position: relative;
    width: 500px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1800px;
    transform-style: preserve-3d;
}

.photo {
    position: absolute;
    /* 其实img标签可以不需要 */
    background-image: url(1.jpg);
    /* 不去看尺寸了，直接用img标签 */
    /* width: auto; */
    transition: 0.5s;
    transform-style: preserve-3d;
}

.photo span {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    /* 继承父级元素背景图 */
    background-image: inherit;
    transition: 1s;
}

.container:hover .photo {
    transform: rotateX(45deg) rotateZ(-50deg) translateZ(30px);
}

.container:hover span:nth-child(1) {
    transform: translateX(-20px) translateY(20px) translateZ(-25px);
    opacity: 0.6;
}

.container:hover span:nth-child(2) {
    transform: translateX(-40px) translateY(40px) translateZ(-50px);
    opacity: 0.3;
}

.container:hover span:nth-child(3) {
    transform: translateX(-60px) translateY(60px) translateZ(-75px);
    opacity: 0.1;
}

.container:hover span:nth-child(4) {
    transform: translateX(-80px) translateY(80px) translateZ(-100px);
    opacity: 0.1;
    background-image: none;
    background-color: #0984e3;
}